<?php
namespace app\common\command;

use app\common\service\PlanService;
use think\admin\Command;
use think\admin\Exception;
use think\console\Input;
use think\console\Output;

class OverdueOrder extends Command
{

    protected function configure()
    {
        $this->setName('xcommon:OverdueOrder');
        $this->setDescription('账单逾期');
    }

    /**
     * 业务指令执行
     * @param Input $input
     * @param Output $output
     * @return void
     * @throws Exception
     */
    protected function execute(Input $input, Output $output)
    {
        $this->action();
    }

    private function action()
    {
        try {
            PlanService::overdue();
        } catch (\Exception $e){
            $this->queue->error($e->getMessage());
        }
    }
}